﻿using System;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;

namespace HystrixCoreDemo.Models
{
    public class Person
    {
        [HystrixCommand(nameof(HelloAsyncFallback))]
        public virtual async Task<string> HelloAsync(string name)
        {
            Console.WriteLine($"Hello:{name}");

            return "OK";
        }

        public virtual async Task<string> HelloAsyncFallback(string name)
        {
            Console.WriteLine($"Hello-Fallback:{name}");

            return "Fallback";
        }
    }
}
